//
//  TextViewForProfession.m
//  A段项目
//
//  Created by dllo on 16/3/1.
//  Copyright © 2016年 Scott. All rights reserved.
//

#import "TextViewForProfession.h"

@interface TextViewForProfession () <UITextFieldDelegate>



@end

@implementation TextViewForProfession

-(void)dealloc {
    
    [super dealloc];
    
    [_titleForThere release];
    [_textField release];
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
   // self.textField = [[UITextField alloc] initWithFrame:CGRectMake(20, 100, self.view.bounds.size.width - 40, 100)];
    
    self.textField.frame= CGRectMake(20, 100, self.view.bounds.size.width - 40, 100);
    
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"保存" style:1 target:self action:@selector(saveAction)];
    
    self.textField.layer.borderWidth = 5;
    
    self.textField.layer.cornerRadius = 5;
    
    self.textField.textAlignment = 1;
    
    self.textField.adjustsFontSizeToFitWidth = YES;

   self.textField.layer.borderColor = [[UIColor lightGrayColor]CGColor];
    
    self.textField.delegate = self;
    
    self.navigationItem.title = [NSString stringWithString:self.titleForThere];
    
    [self.textField becomeFirstResponder];
    
    [self.view addSubview:self.textField];
    
    [_textField release];
    
}

- (void)saveAction {
    
    
    [self.delegate passedEditedInfo:self.textField.text :self.index];
    
    [self.navigationController popViewControllerAnimated:YES];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
